/**
 * Copyright 2014 the original author or authors. All rights reserved.
 */
package com.visionet.security.support;

import java.util.List;

import com.visionet.jumper.core.domain.bean.Page;
import com.visionet.jumper.core.support.spring.SpringLocator;
import com.visionet.security.domain.dto.UrlizedResource;
import com.visionet.security.service.SecurityResourceService;

/**
 * @author suxiaojing
 * @date 
 * @since 0.0.1
 */
public class ResourceHelper {

	private ResourceHelper() {
	}

	public static List<UrlizedResource> getMenu() {
		SecurityResourceService resourceService = SpringLocator.getBean(SecurityResourceService.class);
		List<UrlizedResource> menu = resourceService.getMenu();
		return menu;
	}

	public static List<UrlizedResource> getUserMenu() {
		SecurityResourceService resourceService = SpringLocator.getBean(SecurityResourceService.class);
		List<UrlizedResource> menu = resourceService.getUserMenu(UserContext.getUserId());
		return menu;
	}

	/**
	 * Get all can be urlized resource
	 * 
	 * @return
	 */
	public static List<UrlizedResource> getUrlizedResource() {
		SecurityResourceService resourceService = SpringLocator.getBean(SecurityResourceService.class);
		List<UrlizedResource> resourceList = resourceService.getUrlizedResource();
		return resourceList;
	}

	public static Page getMenuForPage(Page page) {
		SecurityResourceService resourceService = SpringLocator.getBean(SecurityResourceService.class);
		return resourceService.getMenuForPage(page);
	}

}
